package com.acoreful.acf2java.admin.modules.auth.support.security;

import com.acoreful.acf2java.commons.security.EncodeUtils;
import com.acoreful.acf2java.commons.security.Sha1Utils;

public final class PasswordEncoder {
	

	/**
	 * @param salt
	 * @param rawPassword
	 * @return
	 */
	public static String encrypt(String salt, String rawPassword) {
        byte[] hashPassword = Sha1Utils.sha1(rawPassword.getBytes(), EncodeUtils.decodeHex(salt), 1024); // 以salt为混淆码进行1024次sha1算法加密
        return EncodeUtils.encodeHex(hashPassword);
    }
}
